﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using _0912276_ChatClient.DTO;

namespace _0912276_ChatClient
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HyperLink hl = (HyperLink)Master.FindControl("HLGoldMember");
            hl.CssClass = "activebox";
            //try
            //{
                string id = Request.QueryString["id"];
                if (!IsPostBack)
                {

                    if (id != null)
                    {
                        BO.MemberShipBO.DeleteMember(int.Parse(id));
                    }
                    BidingData();
                }
            //}
            //catch (Exception ex)
            //{
            //    Response.Redirect("~/GoldMember.aspx");
            //}
        }

        private void BidingData()
        {
            IEnumerable<employee> Result = BO.SearchMember.FindMemberWithTypePlus(1);
            GridView1.DataSource = Result.ToList();
            GridView1.DataBind();
        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            BidingData();
        }
    }
}